// -----------------------------------------------------------------------
//  <copyright file="Program.cs" company="LiuliuSoft">
//      Copyright (c) 2025 66SOFT. All rights reserved.
//  </copyright>
//  <site>https://ifs.66soft.net</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-01-26 13:01</last-date>
// -----------------------------------------------------------------------

using System.Text;

using CommunityToolkit.Aspire.Hosting.Dapr;

using Projects;


Console.OutputEncoding = Encoding.UTF8;

var builder = DistributedApplication.CreateBuilder(args);

var daprComponentOptions = new DaprComponentOptions() { LocalPath = "./.dapr/components" };
var stateStore = builder.AddDaprStateStore("statestore", daprComponentOptions);
var pubSub = builder.AddDaprPubSub("pubsub", daprComponentOptions);

builder.AddProject<ApiGateway>("ApiGateway")
    .WithDaprSidecar()
    .WithReference(stateStore)
    .WithReference(pubSub);
builder.AddProject<Identity_Api>("IdentityApi")
    .WithDaprSidecar()
    .WithReference(stateStore)
    .WithReference(pubSub);
builder.AddProject<Todos_Api>("TodosApi")
    .WithDaprSidecar()
    .WithReference(stateStore)
    .WithReference(pubSub);

builder.Build().Run();
